package factotyService.trance;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.json.JSONException;

import service.ArticleService;
import service.ImpArticleServiceByServlet;
import factotyService.AbstractService;

public class LoadArticle extends AbstractService {
	
	private static ArticleService service = new ImpArticleServiceByServlet();//可用工厂方法生产实例
	public LoadArticle(){}
	public LoadArticle(HttpServletRequest req, HttpServletResponse res) throws IOException, JSONException{
		super(req, res);
	}
	
	/* (non-Javadoc)
	 * @see factotyService.AbstractService#check()
	 */
	@Override
	public void check() {
		// TODO Auto-generated method stub
		/*String user_id = null;
		try {
			user_id = this.data.getString("");
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		if (user_id == "" || user_id == null){
			
		}*/
	}

	/* (non-Javadoc)
	 * @see factotyService.AbstractService#hand()
	 */
	@Override
	public void hand() {
		// TODO Auto-generated method stub
		try {
			this.result = service.loadArticle(this.data.getString("user_id"));
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			System.out.println("Json异常");
			e.printStackTrace();
		}
		
	}
	
}
